<?xml version="1.0" encoding="UTF-8"?>

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:p="http://primefaces.org/ui"
     template="../../Template.xhtml"
>
<ui:define name="title">Add Record </ui:define>

<ui:define name="body">

<h:form>
	<p:panelGrid columns="2">
<h2>Add Record </h2>
<p:commandButton value="Back" action="ManageCalcule.xhtml" />
</p:panelGrid>
</h:form>
<br/><br/><br/><br/>
<h:form>

<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />

	<p:panelGrid columns="3">
	
	<p:outputLabel value="Country :"/>
	<p:selectOneMenu value="#{calculEstimationMB.idCt}" >
			
			<f:selectItems  value="#{calculEstimationMB.listPays}"  var="a" itemValue="#{a.idPays}" itemLabel="#{a.intitule}"  />
	</p:selectOneMenu><br/>
		
	
		<p:outputLabel value="Transport Type :"/>
		 <p:selectCheckboxMenu required="true" requiredMessage="transport type is required" id="transport" value="#{calculEstimationMB.listTransport}" label="Transport"
                              filter="true" filterMatchMode="startsWith" panelStyle="width:250px">
         <f:selectItems value="#{calculEstimationMB.listTransportt}" var="a" itemLabel="#{a.intitule}"  itemValue="#{a.idTransport}" />
        </p:selectCheckboxMenu>
		<p:message for="transport" />
		
		<p:outputLabel value="Distance(KM) :"/>
		<p:inputText id="distance" value="#{calculEstimationMB.calculeEstim.distance}" required="true" requiredMessage="distance is required" />
		<p:message for="distance" />
		
		
		<p:outputLabel value="Weight :"/>
		<p:inputText id="weight" value="#{calculEstimationMB.calculeEstim.poids}" required="true" requiredMessage="Weight is required" />
		<p:message for="weight" />
		
		
		
		<p:outputLabel value="Price :"/>
		<p:inputText id="price" value="#{calculEstimationMB.calculeEstim.prix}" required="true" requiredMessage="Price is required" />
		<p:message for="price" />
		
		<p:outputLabel value="Status :" />
		<p:selectOneMenu value="#{calculEstimationMB.calculeEstim.statut}" >
			<f:selectItem  itemValue="true" itemLabel="Active"  />
			<f:selectItem  itemValue="false" itemLabel="Inactive"  />
		</p:selectOneMenu><br/>
		<p:commandButton action="#{calculEstimationMB.Ajouter}" value="Add" ></p:commandButton>
	</p:panelGrid>
</h:form>
	
</ui:define>
</ui:composition>